package repositories

import (
	"gitee.com/cjf8134/bbs_serve/internal/pkg/database"
	"github.com/google/wire"
	"github.com/jinzhu/gorm"
	es "github.com/olivere/elastic/v7"
	"go.uber.org/zap"
)

type MysqlApiServeRepository struct {
	logger   *zap.Logger
	db       *gorm.DB
	esClient *es.Client
}

func NewMysqlApiServeRepository(logger *zap.Logger, db *database.Database, esClient *es.Client) MysqlApiServeRepository {
	return MysqlApiServeRepository{
		logger:   logger.With(zap.String("type", "MysqlApiServeRepository")),
		db:       db.Mysql,
		esClient: esClient,
	}
}

var ProviderSet = wire.NewSet(NewMysqlApiServeRepository)
